home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / usr / include / pidgin / gtkstatusbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-04  |  5.3 KB  |  187 lines

  1. /*
  2.  * @file gtkstatusbox.c GTK+ Status Selection Widget
  3.  * @ingroup pidgin
  4.  *
  5.  * pidgin
  6.  *
  7.  * Pidgin is the legal property of its developers, whose names are too numerous
  8.  * to list here.  Please refer to the COPYRIGHT file distributed with this
  9.  * source distribution.
  10.  *
  11.  * This program is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2 of the License, or
  14.  * (at your option) any later version.
  15.  *
  16.  * This program is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; if not, write to the Free Software
  23.  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  24.  */
  25.  
  26.  
  27. #ifndef __PIDGIN_STATUS_BOX_H__
  28. #define __PIDGIN_STATUS_BOX_H__
  29.  
  30. #include <gtk/gtk.h>
  31. #include "gtkimhtml.h"
  32. #include "account.h"
  33. #include "imgstore.h"
  34. #include "savedstatuses.h"
  35. #include "status.h"
  36. #include <gtk/gtktreemodel.h>
  37. #include <gtk/gtktreeview.h>
  38.  
  39. G_BEGIN_DECLS
  40.  
  41. #define PIDGIN_TYPE_STATUS_BOX             (pidgin_status_box_get_type ())
  42. #define PIDGIN_STATUS_BOX(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIDGIN_TYPE_STATUS_BOX, PidginStatusBox))
  43. #define PIDGIN_STATUS_BOX_CLASS(vtable)    (G_TYPE_CHECK_CLASS_CAST ((vtable), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass))
  44. #define PIDGIN_IS_STATUS_BOX(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), PIDGIN_TYPE_STATUS_BOX))
  45. #define PIDGIN_IS_STATUS_BOX_CLASS(vtable) (G_TYPE_CHECK_CLASS_TYPE ((vtable), PIDGIN_TYPE_STATUS_BOX))
  46. #define PIDGIN_STATUS_BOX_GET_CLASS(inst)  (G_TYPE_INSTANCE_GET_CLASS ((inst), PIDGIN_TYPE_STATUS_BOX, PidginStatusBoxClass))
  47.  
  48. /**
  49.  * This is a hidden field in the GtkStatusBox that identifies the
  50.  * item in the list store.  The item could be a normal
  51.  * PurpleStatusPrimitive, or it could be something special like the
  52.  * "Custom..." item, or "Saved..." or a GtkSeparator.
  53.  */
  54. typedef enum
  55. {
  56.     PIDGIN_STATUS_BOX_TYPE_SEPARATOR,
  57.     PIDGIN_STATUS_BOX_TYPE_PRIMITIVE,
  58.     PIDGIN_STATUS_BOX_TYPE_POPULAR,
  59.     PIDGIN_STATUS_BOX_TYPE_SAVED_POPULAR,
  60.     PIDGIN_STATUS_BOX_TYPE_CUSTOM,
  61.     PIDGIN_STATUS_BOX_TYPE_SAVED,
  62.     PIDGIN_STATUS_BOX_NUM_TYPES
  63. } PidginStatusBoxItemType;
  64.  
  65. typedef struct _PidginStatusBox      PidginStatusBox;
  66. typedef struct _PidginStatusBoxClass PidginStatusBoxClass;
  67.  
  68. struct _PidginStatusBox
  69. {
  70.     GtkContainer parent_instance;
  71.  
  72.     /**
  73.      * This GtkListStore contains only one row--the currently selected status.
  74.      */
  75.     GtkListStore *store;
  76.  
  77.     /**
  78.      * This is the dropdown GtkListStore that contains the available statuses,
  79.      * plus some recently used statuses, plus the "Custom..." and "Saved..."
  80.      * options.
  81.      */
  82.     GtkListStore *dropdown_store;
  83.  
  84.     PurpleAccount *account;
  85.  
  86.     /* This will be non-NULL and contain a sample account
  87.      * when all enabled accounts use the same statuses */
  88.     PurpleAccount *token_status_account;
  89.  
  90.     GtkWidget *vbox, *sw;
  91.     GtkWidget *imhtml;
  92.  
  93.     PurpleStoredImage *buddy_icon_img;
  94.     GdkPixbuf *buddy_icon;
  95.     GdkPixbuf *buddy_icon_hover;
  96.     GtkWidget *buddy_icon_sel;
  97.     GtkWidget *icon;
  98.     GtkWidget *icon_box;
  99.     GtkWidget *icon_box_menu;
  100.     GdkCursor *hand_cursor;
  101.     GdkCursor *arrow_cursor;
  102.         int icon_size;
  103.         gboolean icon_opaque;
  104.  
  105.     gboolean imhtml_visible;
  106.  
  107.     GtkWidget *cell_view;
  108.     GtkCellRenderer *icon_rend;
  109.     GtkCellRenderer *text_rend;
  110.  
  111.     GdkPixbuf *error_pixbuf;
  112.     int connecting_index;
  113.     GdkPixbuf *connecting_pixbufs[9];
  114.     int typing_index;
  115.     GdkPixbuf *typing_pixbufs[6];
  116.  
  117.     gboolean network_available;
  118.     gboolean connecting;
  119.     guint typing;
  120.  
  121.     GtkTreeIter iter;
  122.     char *error;
  123.  
  124.     /*
  125.      * These widgets are made for renderin'
  126.      * That's just what they'll do
  127.      * One of these days these widgets
  128.      * Are gonna render all over you
  129.      */
  130.     GtkWidget *hbox;
  131.     GtkWidget *toggle_button;
  132.     GtkWidget *vsep;
  133.     GtkWidget *arrow;
  134.  
  135.     GtkWidget *popup_window;
  136.     GtkWidget *popup_frame;
  137.     GtkWidget *scrolled_window;
  138.     GtkWidget *cell_view_frame;
  139.     GtkTreeViewColumn *column;
  140.     GtkWidget *tree_view;
  141.     gboolean popup_in_progress;
  142.     GtkTreeRowReference *active_row;
  143. };
  144.  
  145. struct _PidginStatusBoxClass
  146. {
  147.     GtkContainerClass parent_class;
  148.  
  149.     /* signals */
  150.     void     (* changed)          (GtkComboBox *combo_box);
  151.  
  152.     /* Padding for future expansion */
  153.     void (*_gtk_reserved0) (void);
  154.     void (*_gtk_reserved1) (void);
  155.     void (*_gtk_reserved2) (void);
  156.     void (*_gtk_reserved3) (void);
  157. };
  158.  
  159.  
  160. GType         pidgin_status_box_get_type         (void) G_GNUC_CONST;
  161. GtkWidget    *pidgin_status_box_new              (void);
  162. GtkWidget    *pidgin_status_box_new_with_account (PurpleAccount *);
  163.  
  164. void
  165. pidgin_status_box_add(PidginStatusBox *status_box, PidginStatusBoxItemType type, GdkPixbuf *pixbuf, const char *text, const char *sec_text, gpointer data);
  166.  
  167. void
  168. pidgin_status_box_add_separator(PidginStatusBox *status_box);
  169.  
  170. void
  171. pidgin_status_box_set_network_available(PidginStatusBox *status_box, gboolean available);
  172.  
  173. void
  174. pidgin_status_box_set_connecting(PidginStatusBox *status_box, gboolean connecting);
  175.  
  176. void
  177. pidgin_status_box_pulse_connecting(PidginStatusBox *status_box);
  178.  
  179. void
  180. pidgin_status_box_set_buddy_icon(PidginStatusBox *status_box, PurpleStoredImage *img);
  181.  
  182. char *pidgin_status_box_get_message(PidginStatusBox *status_box);
  183.  
  184. G_END_DECLS
  185.  
  186. #endif /* __GTK_PIDGIN_STATUS_COMBO_BOX_H__ */
  187.